<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title><?php echo $pageTitle?></title>
	<script type='text/javascript' src="<?php echo base_url();?>sknimg/js/jquery-1.4.2.js"></script>
	<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url();?>sknimg/img/isee.ico" />
	<link href="<?php echo base_url();?>sknimg/css/userarea.css" rel="stylesheet" type="text/css" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url();?>sknimg/img/icon.png" />
	
	
    <script type='text/javascript' src="<?php echo base_url();?>sknimg/js/jquery-ui-1.8.1.custom.min.js"></script>
	<link type="text/css" href="<?php echo base_url();?>sknimg/css/js-ui-css/ui-lightness/jquery-ui-1.8.1.custom.css" rel="stylesheet" />
	
	<?php if($pageTitle == "Echo Group $title"){?>
	<script type="text/javascript">
	$(document).ready(function(){
	 var num_messages = <?php echo $num_messages?>;
		var loaded_messages = 10;
		if(loaded_messages >= num_messages)
		{
			$("#more_button").hide();
			//alert('hide');
		}
			$("#more_button").click(function(){
				
				$.get("<?php echo base_url()?>engine/potses/get/<?php echo $page?>/" + loaded_messages, function(data){
					$("#statuses").append(data);

				});
				loaded_messages += 10;
				if(loaded_messages >= num_messages)
				{
					$("#more_button").hide();
					//alert('hide');
				}
			})
})
	</script>
	<?php }?>
	
	</head>
<body>
		<div id="wraper">
			<?php require_once 'include/headeruser.php';?>
			<div class="skin">
				<div id="content">
					<div class="avatar">
						<div class="name"><a href="<?php echo base_url()?>profile/info/<?php echo $groupname?>"><?php echo $title?></a></div>
						<div class="picAvatar">
							<div id='photo'>
								<img width='200px' height='200px' src='<?php echo base_url()."sknimg/i-see-attr/avatar/".$avatar?>'></img>
							</div>	
						</div>
					</div>
						
					<div class="contentuser">
					<div class="menuuser">
							<a href="<?php echo base_url()?>groups/info/<?php echo $groupname?>" class='onpage'>Info</a>
							<a href="<?php echo base_url()?>groups/members/<?php echo $groupname?>">Anggota Group (<?php echo $num_followers?>)</a>
							<?php if($this->session->userdata('isLogin')){?>
								<?php if($isGroupAdmin){?>
									<a href="<?php echo base_url()?>groups/admins/<?php echo $groupname?>">Pengaturan Group</a>
								<?php }?>
							<?php }?>
							<a href="<?php echo base_url()?>groups/echos/<?php echo $groupname?>">Echos</a>
					</div>
				
					
					<?php if($pageTitle == "Group $title"){?>
						<div id="twitter-container" style="float:left;width:500px;">
							<ul class="statuses" id='statuses' style="padding:0;">
								<li style="padding:0">
									<a href="<?php echo base_url()?>groups/info/<?php echo $groupname?>">Group url : </a>
										<div class="tweetTxt"> 
										<?php echo base_url()?>groups/info/<?php echo $groupname?>
										</div>
									<div class="clear"></div>
								</li>
								<li style="padding:0">
									<a href="javascript:;">Nama Group : </a>
										<div class="tweetTxt"> 
										<?php echo $title?>
										</div>
									<div class="clear"></div>
								</li>
								<li style="padding:0">
									<a href="javascript:;">Deskripsi : </a>
										<div class="tweetTxt"> 
										<?php echo $about_me?>
										</div>
									<div class="clear"></div>
								</li>
								<li style="padding:0">
									<a href="javascript:;">Jumlah Anggota : </a>
										<div class="tweetTxt"> 
										<?php echo $num_followers?> orang
										</div>
									<div class="clear"></div>
								</li>
								<?php if($this->session->userdata('isLogin')){?>
									<?php if(!$isMyGroup){?>
										<li style="float:right">
											<form action="<?php echo base_url()?>groups/info/<?php echo $groupname?>" method="post">
												<input type="submit" class="upload" name="join" value="Bergabung"></input>
											</form>
											<div class="clear"></div>
										</li>
									<?php }else{?>
										<?php if($needLeave){?>
										 	<li style="float:right">
										 		<div class="tweetTxt"> 
													Anda Adalah Admin dari Group Ini, jika anda meninggalkan Group ini maka group akan otomatis terhapus!!
												</div>
												<form action="<?php echo base_url()?>groups/info/<?php echo $groupname?>" method="post">
													<input type="submit" class="upload" name="leaveDelete" value="Keluar"></input>
												</form>
												<form action="<?php echo base_url()?>groups/info/<?php echo $groupname?>" method="post">
													<input type="submit" class="upload" name="noLeave" value="Batal"></input>
												</form>
												<div class="clear"></div>
											</li>
										<?php }else{?>
											<li style="float:right">
												<form action="<?php echo base_url()?>groups/info/<?php echo $groupname?>" method="post">
													<input type="submit" class="upload" name="leave" value="Keluar"></input>
												</form>
												<div class="clear"></div>
											</li>
										<?php }?>
									<?php }?>
								<?php }?>
							</ul>
						</div>
					<?php }elseif($pageTitle == "Anggota Group $title"){?>
						<div id="twitter-container" style="float:left;width:500px;">
							<ul class="statuses" id='statuses' style="padding:0;">
								<?php for($i=0;$i<sizeOf($user_id);$i++){?>
									<li>
										<a href="<?php echo base_url()?>profile/info/<?php echo $username[$i]?>">
											<img src="<?php echo base_url()?>sknimg/i-see-attr/avatarThumb/<?php echo $useravatar[$i]?>" width="50" height="50" class="avatarecho" alt="avatar"></img>
										</a>
										<div class="tweetTxt"> 
											<a style='text-decoration:none' href="<?php echo base_url()?>profile/info/<?php echo $username[$i]?>">
												<?php echo $nama[$i]?>
											</a>
											<div class='date'><?php if($itIsGroupAdmin[$i]){?>Admin<?php }?></div>
										</div>
										<div class="clear"></div>
									</li>
								<?php }?>
							</ul>
						</div>
					<?php }elseif($pageTitle == "Pengaturan Group $title"){?>
						<div id="twitter-container" style="float:left;width:500px;">
							<ul class="statuses" id='statuses' style="padding:0;">
								<li>
								<form method="post" action="<?php echo base_url()?>groups/admins/<?php echo $groupname?>" enctype="multipart/form-data">
									<table>
										<tr>
											<td>
												Group Name :
											</td>
											<td>
												<input type='text' name='namagroup' value="<?php echo $title?>" size=45></input>
											</td>
										</tr>
										<tr>
											<td>
												Deskripsi :
											</td>
											<td>
												<textarea name='about_me' cols="39" rows="5"><?php echo $about_me?></textarea>
											</td>
										</tr>
										<tr>
											<td>
												Group Avatar :
											</td>
											<td>
												<img src="<?php echo base_url()?>sknimg/i-see-attr/avatarThumb/<?php echo $avatar?>" width="50" height="50" class="avatarecho" alt="avatar"></img>
												<br>
												<input type='file' name="groupavatar"></input>
												<?php if(!$noError){?>
												<br>
												<?php echo $errorMsg?>
												<?php }?>
											</td>
										</tr>
									</table>
								</li>
								<input type="submit" class="upload" name="update" value="Update"></input>
								</form>
								<form style="float:right" action="<?php echo base_url()?>groups/admins/<?php echo $groupname?>" method="post">
									<input type="submit" class="upload" name="delete" value="Hapus Group"></input>
								</form>
							</ul>
						</div>
					<?php }elseif($pageTitle == "Echo Group $title"){?>
						<ul class="statuses" id='statuses'>
						<?php if($myEcho){?>
							<?php echo $myEchoMsg?>
						<?php }else{?>
							<li id="noEcho"><?php echo $whatsWrong?></li>
						<?php }?>
						</ul>
						<div  class="upload" id="more_button"  style="float:none">More</div>
					<?php }?>
					</div>
				</div>
	
			<div class="cls"></div>
		</div>	
	
	<!--footer start -->
	<?php require_once('footer.php');?>
	<!--footer end -->
</div>		
</body>
</html>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             